package devices

import (
	"context"
	v1 "devops-super/api/product/v1"
	"devops-super/internal/service"
	"github.com/gogf/gf/v2/util/gconv"
)

func (*sDevice) SendCmd(ctx context.Context, req *v1.DeviceSendCmdReq) (res *v1.DeviceSendCmdRes, err error) {
	res = &v1.DeviceSendCmdRes{}
	cmd := gconv.Int(req.Cmd)
	err = service.DeviceConfig().PushCmdToDevice(ctx, req.DeviceNo, cmd)
	return
}
